import scrapy
from ..items import SohuItem


class Sohu1Spider(scrapy.Spider):
    name = 'sohu1'
    allowed_domains = ['sohu.com']
    start_urls = ['http://www.sohu.com/a/337634404_100032610']

    def parse(self, response):
        item = SohuItem()
        srcs = response.css('.article img::attr(src)').extract()  # 用css方法找到的所有图片地址
        item['image_urls'] = srcs
        yield item
